﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_LarX
{
    public static class RandomUtil
    {
        public static Random Random = new Random();

        public static float Next(float MinValue, float MaxValue, float Precision)
        {
            int minValue = (int)(MinValue * Precision);
            int maxValue = (int)(MaxValue * Precision);
            return Random.Next(minValue, maxValue) / Precision;
        }
        public static int Next()
        {
            return Random.Next();
        }
        public static int Next(int MaxValue)
        {
            return Random.Next(MaxValue);
        }
        public static int Next(int MinValue, int MaxValue)
        {
            return Random.Next(MinValue, MaxValue);
        }

        public static bool OneToOneHundredProbabilty(int Percentage)
        {
            int random = Random.Next(0, 100);
            return (Percentage >= random);
        }
        public static bool Probability(int Percentage)
        {
            int random = Random.Next(0, 100);
            return (Percentage >= random);
        }
    }
}
